package com.laf.common.core.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;

@Data
public class OCRResult implements Serializable {

    private static final long serialVersionUID = 1L;

    @JsonProperty("name")
    private String name;

    @JsonProperty("sex")
    private String sex;

    @JsonProperty("ethnicity")
    private String ethnicity;

    @JsonProperty("birthDate")
    private String birthDate;

    @JsonProperty("address")
    private String address;

    @JsonProperty("idNumber")
    private String idNumber;


    private String base64;


    @JsonSerialize(using = LocalDateSerializer.class) // 序列化
    @JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate expiryDate;


}
